<template>
  <div>
    <a-form-model ref="form" slot="detail">
      <a-row>
        <a-col :span="24">
          <a-form-model-item label="巡查图片" prop="workBlueprint" :labelCol="labelCol" :wrapperCol="wrapperCol">
            <img v-if="record.images != null" v-for="(item,index) in record.images"
                 @click="handlePreview(index, record.images)" :src="item"
                 style="width: 100px;height: 100px;margin-right: 10px;margin-bottom: 10px">
            <span v-if="record.circuitImg == null">无</span>
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>

  </div>
</template>

<script>
  import { ImagePreview } from 'vant';
  export default {
    name: 'circuitImage',
    props: {
      record: {}
    },
    data() {
      return {
        labelCol: {
          xs: { span: 24 },
          sm: { span: 5 },
        },
        wrapperCol: {
          xs: { span: 24 },
          sm: { span: 16 },
        },

      }
    },
    methods:{
      handlePreview(i, imgList) {
        ImagePreview({
          images: imgList,
          startPosition: i,
        })
      }
    }
  }
</script>

<style scoped>

</style>